# Contributor: prspkt <prspkt@protonmail.com>
# Maintainer: prspkt <prspkt@protonmail.com>
pkgname=py3-lazy-object-proxy
_pkgname=lazy-object-proxy
pkgver=1.10.0
pkgrel=1
pkgdesc="Fast and thorough lazy object proxy"
url="https://github.com/ionelmc/python-lazy-object-proxy"
arch="all"
license="BSD-2-Clause"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-setuptools_scm python3-dev py3-wheel"
checkdepends="py3-pytest-runner py3-pytest-benchmark"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/"$_pkgname-$pkgver

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/lazy*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/lazy*.whl
}

sha512sums="
0693a2b6d13909580e7b568a030b884f84fc1578b17e49ac4246572e3e8b18c05a2613572f24b908630528ecb606d149a106b46d079f2c42ced5172146e413c5  lazy-object-proxy-1.10.0.tar.gz
"
